#include <stdio.h>
#include <signal.h>
#include <unistd.h>
struct sigaction oldact;
void sigcallback(int sig){
  printf("sig is %d\n",sig);

  sigaction(2,&oldact,NULL);

}

int main(){
  struct sigaction act;
  act.sa_handler=sigcallback;
  sigemptyset(&act.sa_mask);

  sigaction(2,&act,&oldact);
  while(1){
    sleep(1);
  }
  return 0;
}
